home *** CD-ROM | disk | FTP | other *** search
/ Holt Researcher: American History / Holt Researcher: American History.iso / pc / modules / dbpictxt.dxr / 00003_Max Min Layout Screen.ls < prev    next >
Encoding:
Text File  |  2000-01-27  |  3.8 KB  |  116 lines

  1. global gDBPicttextVarList
  2.  
  3. on ResizeLayOutScreen
  4.   if the width of sprite 1 = 640 then
  5.     size = 1
  6.   else
  7.     size = 2
  8.   end if
  9.   SizeWindowArt(size)
  10.   EnableScroll = SizeText(size)
  11.   SizeScroll(size)
  12.   EvalDisableScroll(EnableScroll)
  13.   SizeMIAW(size)
  14.   updateStage()
  15.   SetScrollHandler()
  16. end
  17.  
  18. on SizeWindowArt size
  19.   MyObj = getaProp(gDBPicttextVarList, GetObjProp())
  20.   SetPuppetState([1, 3], #c, 1)
  21.   BorderRect = GetBorderRect(MyObj, size)
  22.   set the rect of sprite 1 to BorderRect
  23.   set the rect of sprite 2 to BorderRect + rect(1, 1, -1, -1)
  24.   xMemberNum = the number of member getAt(["doc min", "doc max"], size)
  25.   set the member of sprite 3 to member(xMemberNum)
  26.   set the rect of sprite 3 to rect(0, 0, member(xMemberNum).width, member(xMemberNum).height)
  27.   SpriteList = GetSpriteList(MyObj)
  28.   ButtonList = GetButtonList(MyObj)
  29.   repeat with rc in ButtonList
  30.     buttonLoc(rc, size)
  31.   end repeat
  32. end
  33.  
  34. on SizeText size
  35.   MyObj = getaProp(gDBPicttextVarList, GetObjProp())
  36.   SpriteList = GetSpriteList(MyObj)
  37.   TextSprite = getaProp(SpriteList, #text)
  38.   memberNum = the member of sprite TextSprite
  39.   NArrowSp = getaProp(SpriteList, #NArrow)
  40.   TextRect = GetTextRect(MyObj, size)
  41.   PictRect = GetPictRect(MyObj)
  42.   if the machineType = 256 then
  43.     PictRect = PictRect + rect(0, -1, 0, -1)
  44.     MinRect = MinRect + rect(0, -1, 0, -1)
  45.     set the textHeight of member memberNum to 14
  46.   end if
  47.   l = getAt(PictRect, 3) + 15
  48.   t = getAt(PictRect, 2)
  49.   R = getAt(TextRect, 3) - the width of sprite NArrowSp - 5
  50.   b = TextRect.bottom
  51.   TextSprite = getaProp(SpriteList, #text)
  52.   EnableScroll = 0
  53.   member(memberNum).rect = rect(l, t, R, b)
  54.   if member(memberNum).height > (GetRectHeight(rect(l, t, R, b)) + 2) then
  55.     EnableScroll = 1
  56.   end if
  57.   set the member of sprite TextSprite to memberNum
  58.   set the loc of sprite TextSprite to point(l, t)
  59.   member(memberNum).scrollTop = 0
  60.   HideSelections(MyObj)
  61.   return EnableScroll
  62. end
  63.  
  64. on SizeScroll size
  65.   MyObj = getaProp(gDBPicttextVarList, GetObjProp())
  66.   SpriteList = GetSpriteList(MyObj)
  67.   OutSideRect = GetBorderRect(MyObj, size)
  68.   InnerRect = GetInsideRect(OutSideRect, 2)
  69.   xRect = GetTextRect(MyObj, size)
  70.   TargMember = GetTextMemberNum(MyObj)
  71.   NArrowSp = getaProp(SpriteList, #NArrow)
  72.   SArrowSp = getaProp(SpriteList, #SArrow)
  73.   ThumbSp = getaProp(SpriteList, #VThumb)
  74.   sL = getAt(InnerRect, 3) - the width of sprite NArrowSp
  75.   sT = getAt(xRect, 2)
  76.   sR = getAt(InnerRect, 3)
  77.   sB = getAt([264, 407], size)
  78.   set the rect of sprite getaProp(SpriteList, #VBed) to rect(sL, sT, sR, sB)
  79.   set the rect of sprite NArrowSp to rect(sL, sT, sR, sT + the height of sprite NArrowSp)
  80.   set the rect of sprite SArrowSp to rect(sL, sB - the height of sprite SArrowSp, sR, sB)
  81.   thumbTop = sT + the height of sprite NArrowSp
  82.   set the rect of sprite ThumbSp to rect(sL, thumbTop, sR, thumbTop + (the member of sprite ThumbSp).height)
  83.   ThumbXLoc = (sR - sL) / 2
  84.   ThumbMin = thumbTop + ((the member of sprite ThumbSp).height / 2)
  85.   ThumbMax = sB - the height of sprite SArrowSp - (the height of sprite ThumbSp / 2)
  86.   numLines = member(TargMember).lineCount
  87.   numVisLines = GetRectHeight(xRect) / the textHeight of member TargMember
  88.   numSettings = numLines - numVisLines + 1
  89.   ResizeScroll(MyObj, ThumbXLoc, ThumbMin, ThumbMax, 1, numSettings, 1, numSettings)
  90. end
  91.  
  92. on SizeMIAW size
  93.   if count(the windowList) > 0 then
  94.     MyObj = getaProp(gDBPicttextVarList, GetObjProp())
  95.     windowName = (the activeWindow).name
  96.     MyRect = window(windowName).rect
  97.     if size = 1 then
  98.       l = getAt(MyRect, 1)
  99.       t = getAt(MyRect, 2)
  100.     else
  101.       l = getAt((the stage).rect, 1)
  102.       t = getAt((the stage).rect, 2) + 26
  103.     end if
  104.     window(windowName).rect = GetBorderRect(MyObj, size) + rect(l, t, l, t)
  105.   end if
  106. end
  107.  
  108. on GetSize
  109.   if the width of sprite 1 < 640 then
  110.     size = 1
  111.   else
  112.     size = 2
  113.   end if
  114.   return size
  115. end
  116.